package com.example.backend.controller;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.example.backend.entity.Card;
import com.example.backend.mapper.CardMapper;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class CardController {
    @Resource
    CardMapper cardMapper;
    @GetMapping("/asd")
    public List<Integer> getAllId(){

        List<Integer> list = new ArrayList<Integer>();
        List<Card> cards=cardMapper.selectList(null);
        if(!cards.isEmpty())
            cards.forEach(card -> {
                list.add(card.getId());
            });
        list.forEach(id->{
            System.out.println(id);
        });
        return list;
    }


}
